package cs

import com.sun.xml.internal.fastinfoset.util.StringArray

/**
 * Created by Administrator on 2019/09/10.
 */
class CS1(name:String) {
    val firstProperty = "First property: $name".also(::println)

    init {
        println("First initializer block that prints ${name}")
    }

    val secondProperty = "Second property: ${name.length}".also(::println)

    init {
        println("Second initializer block that prints ${name.length}")
    }

    constructor(name:String, other: CS1):this(name){

    }

    fun m1(){
        println("m1")
    }
}

fun main(args:Array<String>)
{
    var cs1 = CS1("hello")
    var cs2 = CS1("world", cs1);
    cs1.m1()
}